//package com.shadow.cloud.test;
//
//import feign.codec.Decoder;
//import org.springframework.beans.factory.ObjectFactory;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.cloud.openfeign.support.ResponseEntityDecoder;
//import org.springframework.cloud.openfeign.support.SpringDecoder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.MediaType;
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
//
//import java.util.Collections;
//
///**
// * 解决 HttpMessageConverters Bean未注册问题
// */
//@Configuration
//public class DecoderConfig {
//
//    @Bean
//    public Decoder feignDecoder() {
//        return new ResponseEntityDecoder(new SpringDecoder(feignHttpMessageConverter()));
//    }
//
//    public ObjectFactory<HttpMessageConverters> feignHttpMessageConverter() {
//        return () -> new HttpMessageConverters(new GateWayMappingJackson2HttpMessageConverter());
//    }
//
//    public static class GateWayMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter {
//        GateWayMappingJackson2HttpMessageConverter() {
//            setSupportedMediaTypes(Collections.singletonList(MediaType.valueOf(MediaType.TEXT_HTML_VALUE + ";charset=UTF-8")));
//        }
//    }
//}